<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        .container{
            width: 500px;
            height: 500px;
            background-color: #555;
            display: flex;
            /* 默认弹性盒里内容横向摆放 */

            flex-direction: row;

            /* flex-direction 属性指定了弹性子元素在父容器中的位置
            row：横向从左到右排列（左对齐），默认的排列方式
            row-reverse：反转横向排列（右对齐，从后往前排，最后一项排在最前面）
            column：纵向排列
            column-reverse：反转纵向排列，从后往前排，最后一项排在最上面 */
            
            
            justify-content: center;
            /* justify-content: flex-end; */
            /* justify-content: flex-start; */

            /* align-items: flex-start; */
            /* align-items: flex-end; */
            align-items: center;
        }

        .box1{
            width: 100px;
            height: 100px;
            background-color: red;
            flex: 2;
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color: green;
            flex: 2;
        }
        .box3{
            width: 100px;
            height: 100px;
            background-color: blue;
            flex: 1;
        }
    </style>

</head>
<body>
    <div class="container">
        <div class="box1"></div>
        <div class="box2"></div>
        <div class="box3"></div>
    </div>
</body>
</html>